/**
 * @Author: liutao
 * @Date:   2017-03-16T10:49:09+08:00
 * @Email:  947809647@qq.com
 * @Last modified by:   liutao
 * @Last modified time: 2017-04-20T19:45:11+08:00
 */

import { getBetaDaySummaryList, showMsg } from '../../../vuex/action'
import QueryModal from '../common/query-modal/query-modal.vue'

export default {
  data() {
    return {
      showQueryModal: false,
      params: {
        start: 0,
        limit: 9999,
        startTime: '',
        endTime: '',
        type: '',
        market: ''
      },
      list: []
    }
  },
  events: {
    toogle_query() {
      this.queryBetaDaySummaryList()
    }
  },
  methods: {
    queryBetaDaySummaryList() {
      this.xGetBetaDaySummaryList(this.params).then((res) => {
        this.showQueryModal = false
        this.list = res.data.list
      }).catch((res) => {
        this.xShowMsg({
					type: 'danger',
					content: res.error_msg
				})
      })
    }
  },
  vuex: {
    actions: {
      xGetBetaDaySummaryList: getBetaDaySummaryList,
      xShowMsg: showMsg
    }
  },
  components: {
    'query-modal': QueryModal
  }
}
